﻿using FreeSql;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using FreeSql.DataAnnotations;
using System.ComponentModel.DataAnnotations;

namespace BBCore.Core.Models.Admins
{
    /// <summary>
    /// 数字字典类型实体
    /// </summary>
    [Table(Name = "HYJ_SysDictType")]
    [Description("数字字典类型实体")]
    //[Index("uk_TypeName_TypeCode", "TypeName,TypeCode", true)] //唯一键
    public class SysDictType:BaseEntity<SysDictType, int>
    {
        [Column(StringLength = 50)]
        [Display(Name = "字典名称")]
        [Required(ErrorMessage = "字典名称不能为空")]
        public string? TypeName { get; set; }

        [Column(StringLength = 50)]
        [Display(Name = "字典代码")]
        [Required(ErrorMessage = "字典代码不能为空")]
        public string? TypeCode { get; set; }
        [Display(Name = "是否启用")]
      
        public bool Status { get; set; } = true;
        [Navigate(nameof(SysDictData.TypeId))]
        public List<SysDictData>? DictDatas { get; set; }
    }
}
